<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台管理</title>
    {%include 'admin/csbase.html'%}
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox">
            <div class="ibox-content">
                货币类型：<select name="btype" id="btype">
                                <option value="0">挖矿收益</option>
                                <option value="1">用户钱包</option>
                            </select>  <br>
                变动类型：<select name="action" id="action">
                                <option value="0">减少</option>
                                <option value="1">增加</option>
                            </select> <br>
                变动会员：<input type="text" name="user" id="user">   <br>
                变动金额：<input type="text" name="price" id="price">   <br>
                操作备注：<input type="text" name="note" id="note">   <br>

                <input type="button" value="确认" onclick="change()">
            </div>
        </div>
    </div>
    {%include 'admin/jsbase.html'%}
    

<script>
function change(){
    var btype = document.getElementById("btype").value;
    var action = document.getElementById("action").value;
    var user = document.getElementById("user").value;
    var price = document.getElementById("price").value;
    var note = document.getElementById("note").value;


    var postdata = {
        'btype':btype,
        'action':action,
        'user':user,
        'price':price,
        'note':note,
        'csrf_token': "{{csrf_token()}}"
    };


    $.ajax({
       url: '{{url_for("admin.cash_monenychange_post")}}',
       type: 'POST',
       data: postdata,
       success: function( data ) {
        var msg_html = '';
        msg_html += '<br>success:'+data.success+msg_html;
        msg_html += '<br>channel:'+data.channel;
        msg_html += '<br>ts:'+data.ts;
        document.getElementById('message').innerHTML = '<br>'+data.msg+msg_html+document.getElementById('message').innerHTML;
       }
    });
}  

    </script>
</body>
</html>